package com.qf.smartplatform.task;

import com.qf.smartplatform.pojo.SysHumiture;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/*** @author Tgb
 * @version V1.0
 * @Project smartplatform
 * @Package com.qf.smartplatform.task
 * @Description:
 * @Date 2022/9/16 10:21
 */
@Component
public class CheckStatusTask {
    private ApplicationContext applicationContext;
    @Autowired
    public void setApplicationContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }
    @Scheduled(fixedRate = 20000)
    public void StatusTask(){
        System.out.println("StatusTask执行了！！！！！！！！！！！！！！！！！！！！！！！！");
        applicationContext.publishEvent(new CheckStatusTask());
    }
}
